#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=100001,B=300,inf=1<<30,T=10000000;
int n,q;
int xa[N],ya[N],xb[N],yb[N];
int xm,ym,xbk[N*2],ybk[N*2];
struct Q{
    int l,r,id;
}a[N];
bool cmp(Q i,Q j){
    if(i.l/B==j.l/B){
        if((i.l/B)&1)return i.r>j.r;
        return i.r<j.r;
    }
    return i.l<j.l;
}
struct node{
    int tg,s0,s1,s2,s3;
    ll sum;
}t[T];
int tot,rt;
void upd(int p,ll s){
    if(t[p].tg)t[p].sum=s;
    else t[p].sum=t[t[p].s0].sum+t[t[p].s1].sum+t[t[p].s2].sum+t[t[p].s3].sum;
}
inline void modify(int &p,int xl,int xr,int xa,int xb,int yl,int yr,int ya,int yb,int v){
    if(!p)p=++tot;
    if(xa<=xl&&xr<=xb&&ya<=yl&&yr<=yb){
        t[p].tg+=v;
        upd(p,1ll*(xbk[xr+1]-xbk[xl])*(ybk[yr+1]-ybk[yl]));
        return;
    }
    int xm=xl+xr>>1,ym=yl+yr>>1;
    if(xa<=xm&&ya<=ym&&xl<=xm&&yl<=ym)modify(t[p].s0,xl,xm,xa,xb,yl,ym,ya,yb,v);
    if(xa<=xm&&yb>ym&&xl<=xm&&ym<yr)modify(t[p].s1,xl,xm,xa,xb,ym+1,yr,ya,yb,v);
    if(xb>xm&&ya<=ym&&xm<xr&&yl<=ym)modify(t[p].s2,xm+1,xr,xa,xb,yl,ym,ya,yb,v);
    if(xb>xm&&yb>ym&&xm<xr&&ym<yr)modify(t[p].s3,xm+1,xr,xa,xb,ym+1,yr,ya,yb,v);
    upd(p,1ll*(xbk[xr+1]-xbk[xl])*(ybk[yr+1]-ybk[yl]));
}
void add(int p,int v){
    modify(rt,1,xm-1,xa[p],xb[p],1,ym-1,ya[p],yb[p],v);
}
ll ans[N];
int main(){
    ios::sync_with_stdio(0);
    cin.tie(0),cout.tie(0);
    freopen("dierti.in","r",stdin);
    freopen("dierti.out","w",stdout);
    int tid;
    cin>>tid;
    cin>>n>>q;
    for(int i=1;i<=n;i++){
        cin>>xa[i]>>ya[i]>>xb[i]>>yb[i];
        xbk[++xm]=xa[i];
        xbk[++xm]=xb[i]--;
        ybk[++ym]=ya[i];
        ybk[++ym]=yb[i]--;
    }
    sort(xbk+1,xbk+xm+1);
    sort(ybk+1,ybk+ym+1);
    xm=unique(xbk+1,xbk+xm+1)-xbk-1;
    ym=unique(ybk+1,ybk+ym+1)-ybk-1;
    for(int i=1;i<=n;i++){
        xa[i]=upper_bound(xbk+1,xbk+xm+1,xa[i])-xbk-1;
        xb[i]=upper_bound(xbk+1,xbk+xm+1,xb[i])-xbk-1;
        ya[i]=upper_bound(ybk+1,ybk+ym+1,ya[i])-ybk-1;
        yb[i]=upper_bound(ybk+1,ybk+ym+1,yb[i])-ybk-1;
    }
    for(int i=1;i<=q;i++)cin>>a[i].l>>a[i].r,a[i].id=i;
    sort(a+1,a+q+1,cmp);
    int l=1,r=0;
    for(int i=1;i<=q;i++){
        while(r<a[i].r)add(++r,1);
        while(l>a[i].l)add(--l,1);
        while(l<a[i].l)add(l++,-1);
        while(r>a[i].r)add(r--,-1);
        ans[a[i].id]=t[rt].sum;
    }
    for(int i=1;i<=q;i++)cout<<ans[i]<<'\n';
    return 0;
}
